package file;

import java.io.File;
public class FileDemo {
    public static void main(String[] args) {
        File file = new File("./demo.txt");
        // 获取文件名
        String name = file.getName();
        System.out.println(name);
        // 获取文件大小
        long size = file.length();
        System.out.println(size);

        boolean cr = file.canRead();
        System.out.println("是否可读:"+cr);
        boolean cw = file.canWrite();
        System.out.println("是否可写:"+cw);
        boolean ih = file.isHidden();
        System.out.println("是否隐藏:"+ih);
    }

}
